<?php
/*
 * Created on Feb 23, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
	if(isset($_GET['cityId'])){
		include ("includes/ConnectDB_mysqli.php");
		include ('includes/MiscFunctions.php');
		include('models/cityregion_model.php');
		$districts = $cityModel->getDistrictsByCity($_GET['cityId']);
		$data = '[';
		while ($myrow = $cityModel->getArrayNameRegions($districts)){
			$data .= '{id: '. $myrow['id']. ', name: "'. $myrow['name'].'"},';
		}
		$data = substr($data,0,strlen($data)-1);
		$data.= ']';
		echo $data;
	}else{
		echo '[]';
	}
?>